package org.example.project3.Mapper;

import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;
import org.example.project3.Entity.Category;

import java.util.List;

@Mapper
public interface CategoryMapper {
    @Select("select * from articlecategory")
    List<Category> getCategory();
    @Insert("insert into articlecategory (name,othername,category_id,create_time,update_time)" +
            " values (#{name},#{othername},#{categoryId},#{createTime},#{updateTime})")
    void add(Category category);

    @Delete("delete from articlecategory where id = #{id}")
    void delete(Integer id);

    void update(Category category);
}
